package com.itnoob.controller;

import cn.hutool.extra.spring.SpringUtil;
import com.itnoob.controller.service.PayService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

/**
 * @author zhoujun
 * @date 2025/3/21 20:52
 */
@RestController
public class PayController {

    @GetMapping("/pay")
    public String wechatPay(@RequestParam BigDecimal amount,
                            @RequestParam String type){
        PayService payService = SpringUtil.getBean(type);
        payService.pay(amount);
        return type + " Pay success";
    }
}
